#ifndef SYNTAXHIGHLIGHTER_HH
#define SYNTAXHIGHLIGHTER_HH

#include <QtGui>


struct Rule
{
    Rule(QRegExp expr, QTextCharFormat frmt) : expression(expr), format(frmt)
    {
    }

    QRegExp expression;
    QTextCharFormat format;
};


class SyntaxHighlighter : public QSyntaxHighlighter
{
Q_OBJECT
public:
    SyntaxHighlighter(QTextDocument* document);

    void highlightBlock(const QString& text);

private:
    QList<Rule> m_rules;

};

#endif // SYNTAXHIGHLIGHTER_HH
